set(SOURCE ${NXP_LIBRARIES_SOURCE} ${SCNSBSP_SOURCE} ${SCNS_SOURCE} ${SEEKFREE_LIBRARIES_SOURCE}  ${HXPRINTF_SOURCE})
message(STATUS ${SOURCE})
aux_source_directory("./" SRC_MAIN)
add_executable(main ${SRC_MAIN} ${LINKER_SCRIPT} ${SOURCE})


include(CheckIPOSupported)
check_ipo_supported(RESULT supported OUTPUT error)
if (supported)
    message(STATUS "IPO / LTO enabled")
    get_property(target_names DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY BUILDSYSTEM_TARGETS)
    while (target_names)
        list(POP_BACK target_names target)
        message(STATUS ${target})
        set_property(TARGET ${target} PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
    endwhile ()
endif ()
